The U.S. doesn't have exit immigration/customs, so there will be no formalities in Chicago. You can just walk from one gate to the next.
The connection between Terminal 2 and Terminal 1 won't be a problem with 50 minutes if your flight is on time. They are connected airside, which is to say you won't have to re-clear security.
If your departing flight is in the "C" gates, and you aren't a fast walker, you may want to consider taking the shuttle bus that departs for near gate E4 and ends up at C9. It cuts down the distance, but if you move briskly you will likely be able to get there on foot faster.