Not sure, but I believe there are nuke-proof bunkers that could secure humanity if such an event were ever to occur.
President Merkin Muffley: [Turns to Strangelove] You mean people could actually stay down there for a hundred years?
Dr. Strangelove: It would not be difficult, Mein Führer. Nuclear reactors could - heh, I'm sorry, Mr. President - nuclear reactors could provide power almost indefinitely...
This makes much more sense after learning the story of Werner von Braun (via Tom Lehrer's song)
Fully appreciating that movie requires a lot of knowledge of history.