There probably was no way Republicans could have won the 1964 election. The party was deeply divided over civil rights, and Senator Barry Goldwater lost in a landslide. But Democratic President Lyndon Johnson certainly had his vulnerabilities. In the fall of 1963, a team of journalists for Life magazine were preparing an expose on Johnson's financial shenanigans that might have led to his resignation or prosecution. The investigation was shelved when President Kennedy was assassinated on November 22, 1963. A number of aides to President Kennedy viewed Johnson with contempt, calling him "Rufus Cornpone." They would have liked nothing better than to dump the Texan from the ticket in 1964. But after JFK's death, they, and the country, rallied around LBJ.
A small library of alternative histories have been written as if Kennedy lived, ranging from predictions that Kennedy planned to replace Johnson with North Carolina Governor Terry Sanford; a landslide victory by Kennedy and Sanford in 1964; an early end to the Vietnam War; a successful War on Poverty (funds not drained by Vietnam), and an avoidance of the disillusionment with government and presidents that permeated the late 1960s and 1970s.
More darkly, some have predicted Kennedy's impeachment for covering up sex scandals and early death from Addison's Disease. Like Nixon, Kennedy had a taping system that may have come back to haunt him if it revealed impeachable offenses.
Governor Sanford was a native of Laurinburg, NC, near where I grew up. I knew him and his family, so I like the idea that he almost became president. Given what happened in North Carolina in the first half of 1964, however, it's highly unlikely JFK would have selected him as his vice presidential running mate. Sanford imposed a sales tax on food, to boost education funding, which made him very unpopular even in his Democratic base. He was term-limited so he couldn't run for re-election as governor, but his hand-picked successor, Judge Richardson Preyer, was defeated in the Democratic primary -- widely seen as a repudiation of Sanford himself. Sanford, unlike Johnson if he survived the election season without indictment, would probably not have added Texas, or even one state to the Democratic column.
If only it had rained in Dallas on that fateful November day in 1963, and the Kennedy convertible put the top up, the President would not have been assassinated and history would have turned out differently. This is a classic example of how small actions can have large consequences and "for want of a nail, the kingdom was lost."