After the Electoral College meets in their respective states to cast their ballots, the Presidential election is certified by a Joint Session of Congress. If an ineligible candidate was somehow elected, I assume that the Joint Session would refuse to certify him/her as President. It would be like when the House or Senate refuse to seat a member, but on a much larger scale. I’m not completely positive, but I would imagine that the refusing to certify the elected candidate because he/she were ineligible would result in the the election being thrown into the House for a decision.