Other ways for Hamlin to become President around this time -- Lincoln dies at Fort Stevens; alternatively, Lincoln is assassinated earlier, most intriguingly after the RNC, or even the election, but before the Electoral College.
EDIT ADD: Additional thought -- if Hamlin effectively serves Lincoln's second term, does he seek to be re-elected in his own right in 1868?