This was one of the several goals that the Electoral College was supposed to accomplish (outlined in Article 2, Sec. 1, Clause 3 of the U.S. Constitution). Note: This clause was modified by the 12th Amendment for reasons I'll explain.
In the original plan for presidential elections, each elector would cast two votes for president, one of which could not be for a candidate from the elector's home state. This was done to avoid the "favorite son" problem. The top vote-getter would become president and the 2nd place winner would be the vice president. The theory behind this was that every candidate would be racing for the top prize [being president], and since nobody runs for 2nd place this would prevent two candidates from running together on a party platform. The President and Vice President would likely have conflicting political values, and they would be forced to work together with their respective support bases in Congress resulting in (theoretically) the best compromise position possible.
Of course with hindsight being 20/20 and all, this idea turned out to be very naive. Problems became immediately apparent during the election of 1796 (the first election after George Washington left office) where John Adams and Thomas Jefferson were the two top vote-getters respectively. They were very bitter political enemies with Jefferson subverting Adams' authority everywhere he could with his supporters in Congress. It was a pretty dysfunctional government.
By the very next election in 1800, a lot of gerrymandering had taken place to influence the makeup of the Electoral College. The two factions tried to collude with other members to win, but it inadvertently resulted in a deadlock tie between Thomas Jefferson and Aaron Burr which took 36(!) ballots to finally break, with the result that the same two guys as before (Jefferson and Adams) having their roles reversed.
It was obvious by that point that the original plan was defective, so the 12th Amendment was ratified in 1804 to correct the problem. Under the 12th Amendment, Electors still cast two ballots, but one is specifically for President, and the other specifically for Vice President. There was still no official two-party system, as even the new system would be a free-for-all for both positions, but it was not long after that the candidate for President would select his own running mate for Vice President.
And the rest, as they say, is history.