The present author agrees with that contention, but would like to take it further.
In the case of Trump, his campaign was also aided and abetted by Republican officials in various states, most notably Secretaries of State, who have actively sought to disenfranchise voters. Mother Jones magazine, in a December 2017 article entitled "Rigged: How Trump Really Won," examined how "voter suppression threw Wisconsin to Trump" while also mentioning the voter purging efforts occurring in states including, but not limited to, Ohio, Georgia, Kansas, and Alabama.
Let's be clear, these steps taken to restrict the ability of the citizenry to exercise their right to vote represent a vicious assault on democracy itself - and they impact far more than one, albeit one very important, federal office. Voter suppression has produced many illegitimate "elected" officials. Brian Kemp of Georgia is the Governor of that state, and not Stacey Abrams, because of his strategy to disenfranchise disproportionately low-income and minority voters during his tenure as Secretary of State.
At the core, voter suppression is a tool of powerful oligarchic-inclined interests to hold onto as much political and economic power as possible. These same interests have demonstrated their willingness to bend or break laws in pursuit of this agenda, and do not care if they are deemed to be illegitimate.
For the record, I believe that any President who came to office having won the electoral college but who did not receive the greatest number of popular votes was not legitimately elected, full stop.
From that premise, we need to step back and look at our history and ask: Who was denied the right to vote (de jure or de facto) in each of our past presidential elections? We have had many such elections where significant percentages of the adult population were unable to vote. Thus, one could argue that many of our past Presidents were, from a democratic perspective, elected with something less than a legitimate mandate to govern as determined by the people, all of the people.
I believe the disaggregation of political and economic power and influence, and measures that accomplish those ends, will help prevent voter suppression efforts and similar assaults on the exercise of our inalienable rights. In the meantime, even with a rigged system, victories can still be won...and this must be kept foremost in mind as 2020 nears.