I agree with the point made above. Once you arrive in GRU my recommendation is for you to proceed to AA and check in so you already have your boarding card. You can easily spend 2h with your friends at the Marriot which is located just outside GRU airport and shuttle buses are available. If you allow 2h for the immigration you wont have any problems.
About the TAM flight GIG-MAO you can expect the flight to depart and arrive on time. TAM operates in GIGT2.
Rgs,