Depends on the rules of their party. Technically, we don't elect a President in November, we elect Presidential Electors.
The last time this was an issue was 1912 when Taft's running mate, Vice President Sherman, died a week before the election. There was an orderly procedure in place for choosing a backup, but since it was for veep and for the party that came in third (winning only Utah and Vermont) it might not be suggestive of how things would go in your scenario.
Who/which body did exactly make a decision to allocate all electors Sherman might have received to Nicholas M. Butler?
Probably the Republican National Committee. They are the body who under the 2012 rules would have had authority to replace Romney or Ryan if for any reason either of them had to be withdrawn from the contest.
RULE NO. 9
Filling Vacancies in Nominations
(a) The Republican National Committee is hereby authorized and empowered to fill any and all vacancies which may occur by reason of death, declination, or otherwise of the Republican candidate for President of the United States or the Republican candidate for Vice President of the United States, as nominated by the national convention, or the Republican National Committee may reconvene the national convention for the purpose of filling any such vacancies.
(b) In voting under this rule, the Republican National Committee members representing any state shall be entitled to cast the same number of votes as said state was entitled to cast at the national convention.
(c) In the event that the members of the Republican National Committee from any state shall not be in agreement in the casting of votes hereunder, the votes of such state shall be divided equally, including fractional votes, among the members of the Republican National Committee present or voting by proxy.
(d) No candidate shall be chosen to fill any such vacancy except upon receiving a majority of the
votes entitled to be cast in the election.