I've made this kind of connection before, but I try to avoid a connection under 50 minutes at ORD, particularly in winter, unless i really need to. If everything is on time, you should be fine, even with a B to C connection (which I think is the norm for this kind of cnx, I believe most LGA flights leave/arrive into B, and LAX into C). I also try to make longer connections if I'm flying out of certain airports where on time % isn't great, LGA and EWR being two of them.
Of course, if for some reason you don't make the connection, UA will rebook you on the next available. The good news is that these two routes have frequent flights.