What about a candidate who just lies, saying "what the voters want to hear" with no intention of doing what was implied in the campaign? Are those "legitimate" votes?

A "legitimate" election requires a properly informed electorate given adequate and correct information upon which to make a decision. Trickery, misinformation, lies, misdirection, manipulation, financially outshouting, and all the things we understand as modern "elections" actually mean the results are not legitimate and anti-democratic.