As any other country would
America gained allies when:
- They help them out financially (example: World War II and the Marshall Plan)
- They fight for the same cause (example: France & USA in Revolutionary War)
- They have the same enemies (example: China & USA in WWII against Japan)
- They help a country rebuild (example: Help Japan rebuild after WWII)
hope this helps