United States produced a remarkable fightback to beat the International Team and win the Presidents Cup.