Minecraft wiki entry for Nether_survival, associated text: If the player's portal emerges floating over a lava lake, the portal generates a few extra blocks of ledge at the bottom, but it is still recommended to build that out into a platform, then continue building a path to safety. Upon reaching a safer location, the player can build a shelter there, and a new return portal within it. Deactivate the old portal before the player starts using the new one so that the portal in the Overworld gets linked to the new one.
If you face an impossible situation and die without being able to deactivate the old portal or make a new one, you may need to go back and fix things the hard way.
Hopefully, you got the coordinates of the Nether side of the portal. If your portal was in mid-air, against a cliff, or in some other awkward situation, it is likely that the coordinates that your original portal "should" have gone to was blocked by lava and/or large masses of netherrack. Multiply the coordinates of the Nether portal by 8 to see where its "natural" matching location in the Overworld is, and compare that to the actual coordinates of your original portal in the Overworld. If they're dramatically different, the space between probably represents the hazard that blocked you.
To get a portal to a new place in the Nether, you need to travel at least 1000 blocks from the matching location of where the portal actually came out, and make your new portal there. The next question is, which direction? If you go back toward and past your original portal, your new portal might come out on the other side of the hazard that blocked the original portal, and you need to get back there to decommission that. So, you're better off going away from your original portal, and 1000-plus blocks past where the nether portal you got would have matched. With luck, that may get you to a better location in the Nether. Aside from replacing your old equipment, this jaunt requires much the same preparation as the first, including cobblestone and obsidian.
Once you're back in the Nether at a safer location: First, see if you can do a quick run to retrieve any surviving items, shuttling them back to your new portal if needed (If that looks dangerous or everything's gone into the lava, just forget that and start anew). Build a shelter for your new portal, go back to restock on cobblestone and then go back to where the old portal was. If the location turns out to be salvageable, you may be able to just build a shelter and continue, otherwise:
If the old portal hasn't been broken by ghasts, decommission it by mining a block. Now, scout out a Nether location that comes out someplace more reasonable, as close as possible to your base. You may even be able to make a better location, by building a platform over lava or tunneling into a netherrack mass to get within 16 blocks of your base portal's "natural" coordinates. Now, you can build your new shelter first, then put your return portal inside.