There's nothing in the Constitution about primaries. Nothing about parties. Nothing about candidates. Nothing about nominees, or being nominated. Nothing about being on the ballot. Nothing, for that matter, about Presidential elections (except an oblique reference in the terribly worded XXII Amendment).
The Constitution says that all 50 states may appoint electors, in whatever manner they see fit, and that those electors meet in their state capitols on a day set by Congress and choose the President and Vice President.
So, on December 19, 2016 the electors will meet and choose a President. Presumably they cannot choose someone who is dead. Other than that, they are free to do what seems best.
This is why the electors designated by the two parties are morons, for the most part.
It could be that the electors could choose a deceased candidate if that candidate had finished in the top three of the electoral votes determined by the popular vote of Nov. 8. It’s just that no one has thought of voting for a deceased candidate in this situation before.