To Oswald, Kennedy embodied the American establishment, which was anti-Communist. It likely did not help that he had been aggressive toward Cuba. He would have assassinated anyone else like that. Oswald was a troubled human being from a bad family who became a Communist just so he could mean something, and wanted to see himself as some historic, enduring hero making a historic action. He was an a**hole. Oswald tried to kill General Edwin Walker, who Kennedy got rid of because he was so antithetical to him. And yet Oswald also tried, and succeeded, in killing Kennedy. So Oswald would have shot anyone he could have.