Taken at face value without qualification, JFK offered a false dilemma. While it is not true that we should ask our country "what's in it for me," it is also not true that we should ask ourselves what we can do for our country as if our country's well-being is (or should be) an end in itself. The well-being of a country holds only if and because individual humans are flourishing and rights are being protected. As such, I am to promote the well-being of my country in the same way that I promote the well-being of my car: as a means to an end--in the case of my country, the end is the flourishing of individuals (primarily the country's citizens and secondarily the humans it has no jurisdiction over.) But I can and should promote as an end the flourishing of individuals, and it is primarily individuals within my own sphere of influence (family, neighbors, etc.) whose flourishing I am to promote. Better to take care of what one has the means to care for than to pine for and opine about the utopia not in one's care.
The country (or state, or city...) is fundamentally for the individuals not the individuals for the country. This brings to mind the following anecdote which bears repeating:
During the Great Depression, Mayor Fiorello LaGuardia famously walked into a city welfare office to make an unannounced inspection and found one employee sprawled back in his chair, his feet on his desk, his hat on his head, and a sandwich in his hand. The mayor made an inquiry, and the welfare worker growled through his well-stuffed mouth that he was eating his lunch. LaGuardia strode over to him, knocked his hat off his startled head, and barked, “Stand up and take your hat off when you talk to a citizen!” To the reporter following him, he remarked, “There’s another son of a bitch who has no job.”