The people do not elect the president of the US – the Electoral College does. And while there are numerous reasons why it was set up this way- a main reason was the fear that an eneducated and uninformed populace could be taken advantage of by a dangerous but charismatic candidate.
Currently 29 states, in theory, bind their Electors to vote according to the popular vote. 21 states have no such rules.
And even in the states that, in theory, bind their electors, violating this is generally, at worst, a misdemeanor and a small fine. And legal scholars generally agree that, if challenged, the binding of electors by states would be held unconstitutional.
So, regardless of how the next months turn out- we could find ourselves in a situation where we don’t know who is president until the electoral vote is certified in early 2017. And quite possibly, a nightmare situation where a candidate challenged the election – choosing a state with a court most to their liking, in hopes that without a majority in the Supreme Court- the lower court ruling would stand.