Were you keeping note of your diplomatic relations with Greece and the USA for, say, the 20 turns previous to their declaration of war against you? Because if they were both negative, that is a warning that they were planning on attacking you. Killing off multiple civilizations is enough to make the rest declare war on you.
You should view this massive attack on your empire as a blessing in disguise, because at the end of it, if you act correctly, your enemies will lose their entire armies, maybe some cities, and you will be in a position to do whatever you want militarily. The first thing to do, of course, is kill everything that has invaded your lands.
You probably got lots of gold from sacking Siam, Mongolia and especially Egypt's cities, as the Songhai UA gives you triple gold for capturing cities and barbarian encampments. If you have enough gold to do so, buy ranged units in the cities near the invading armies, then use them to snipe at the enemy, taking them down one by one, going for the weakest first. Try to concentrate firepower by using multiple ranged units plus your city attack on the same enemy, killing it before it has a chance to retreat or heal. Prevent as many enemy units from escaping as you can. Make sure to preserve your own units, as the AI probably has more than you in that area - at least initially. Don't send anybody into an area where four or more enemies can attack it in the same turn. Always keep an escape route open. If any of your units look like they will die in the next turn, move them away from the conflict and heal them.
If you don't have the gold to buy units, then immediately switch production in the nearest cities to build composite bowmen/crossbows, whatever unit you have access to. Emphasize production with the citizens; you can even starve your cities for a while to produce things faster, as long as you switch the citizens back to creating a food surplus before they fully starve. (easy to check this: open the city screen, look at the green 'citizen' icon in the top left. It will show you how much surplus food there is and how fast that amount is growing or shrinking. The turn before the surplus would go away completely, switch enough of your citizens back to gathering food that the overall amount of growth is neutral or positive, rather than negative.)
While fighting the enemy armies near your cities, move your army that captured Egypt back home in order to confront the invaders. You should be able to stall the foes for long enough that the army can make it back, and once it does, crush everything that remains. At this point the bulk of the enemy army should be gone, with your own army strong and close to their borders. This is a very good thing...
Once you've cleaned out your territory of enemy units you should appraise the situation. Are there any cities owned by Greece or the USA that you want to capture and take for your own, or raze? Are there any City-States that you'd like to make a part of your empire? If so, then don't make peace with the enemy until you achieve those goals. Remember, they cannot un-declare war until you decide that you want peace with them. You were able to conquer three other civs, so what remains fighting against you in this war shouldn't be a problem.
After you've taken whatever cities you want you can make peace, if you want to. At this point, with all of their armies gone and potentially lost cities, Greece and the USA will offer very nice deals for peace. It doesn't hurt you to accept them once you have what you want, as you can always go to war again after the ten-turn peace treaty is up.
Yep. Looong-winded post. Hope this is helpful for you.