I believe the story was back in the seventies. People became immortal when they were sure they were going to die and then didn't. I've tried finding it and can't.
Although the story has lots more in it that just the two points you mention, those points closely match Alfred Bester's The Computer Connection.
About the immortals:
They are ordinary humans that, at some point, got in a situation in which it was clear they would die (only to be save in extremis)
They come from all ages (there is even a Neanderthal).
They just don't age, and metabolize anything (so no poisons/toxics affect them); in fact the protagonist refers to the group as Homol to mean that they can metabolize anything. But they can be killed by physical injury.
A quite dystopian society, when poor people living whenever they can, no discernible social order (but there is a working social society), "Pure" white men are almost non-existing and the ones who are still seem to be just mindless drug addicts. Nonetheless, some traditional groups (for example, Native Americans) are doing pretty well (in the case of the indians, because they discovered a way to produce a new drug from a plant).
Now, to the plot:
Narrated in first person by Grand Guignol (or Guig), an immortal that goes around trying to create new immortals by putting "worthy" people in mortal danger (in the end, he usually ends just killing them because he cannot save them in time). At the beggining, he is hiding from police and is sent back in time to give some money to a destitute Victorian poet before he suicides (he does not arrive in time).
The main plot starts when a prospective "member", a Cherokee named Sequoia (Guig already was trying to stage a situation to "kill" him) collapses when he founds that 3 astronauts are missing from a capsule that has spent a long time in orbit. The collapse is enough to make him an Homol, but at the same time, while he collapsed, his brain stablished a connection with the central computer of the main title.
The story becomes more and more complicated, the biggest points being the wedding of Guig to Sequoia's sister, the death of Guig's foster daughter (in the Spanish version, Chca Chino-5), the involment of a renegade Homol (the Rajah) and the fact that the three missing astrounauts did in fact involution to a fetal status and are "growing" again but as hermafrodites.
If none of the above rings a bell, then it is not the book you are looking for.
You may be thinking of Alfred Bester's The Computer Connection. According to the ISFDB it looks like it was first serialized in Analog magazine beginning in November 1974, under the (painfully non-PC) title of The Indian Giver.
From the Amazon link:
A band of immortals - as charming a bunch of eccentrics as you'll ever come across - recruit a new member, the brilliant Cherokee physicist Sequoya Guess. Dr. Guess, with group's help, gain control of Extro, the supercomputer that controls all mechanical activity on Earth. They plan to rid Earth of political repression and to further Guess's researches-which may lead to a great leap in human evolution to produce a race of supermen. But Extro takes over Guess instead and turns malevolent. The task of the merry band suddenly becomes a fight in deadly earnest for the future of Earth.
In the first chapter the main character explains how they obtained immortality:
But our Group has proven that death doesn’t have to be inevitable. Of course we did it the hard way.
Each of us knew we were going to die and received a psychogalvanic shock that wiped out our lethal cell products and turned us into Molecular Men; Molemen for short. I’ll explain that later. It’s a sort of updating of Cuvier’s “Catastrophism” theory of evolution. In case you’ve forgotten, he argued that periodic catastrophes destroyed all life and God started it all over again on a higher level. He was wrong about the God bit, of course, but catastrophes do alter creatures.
As described in each case (with the exception of Hic-Haec-Hoc, who can’t describe anything) the circumstances were almost identical. We were trapped in some natural or man-made catastrophe that gave us no chance of survival; we were aware of it; a psychogalvanic charge ripped through us as we toppled into extinction; then some miracle aborted the death and so here the Group is forever. The odds against this sort of freak are fantastic, but the Greek Syndicate says that even the longest odds are bound to come in sooner or later. The Greek ought to know. He’s been a professional gambler ever since Aristotle kicked him out of the Peripatetic School in Athens.