In this case, Char would deal damage to you and to your opponent.
But instead of Char dealing 2 damage to you, you would exile that many cards from your graveyard instead. But since you can't, you lose the game (see also C.R. 117.12). (Since the damage that would be dealt to you is replaced, it never happens [C.R. 119.4c, 614.6].)
That leaves Char dealing 4 damage to your opponent. The damage dealt by Char this way would make your opponent lose 4 life and make you gain 4 life due to lifelink, but instead you would draw 4 cards, but instead you would win the game since your library is empty (C.R. 119.3a, 119.3f, 614.6).
And if a player would both win and lose the game simultaneously, that player loses the game (C.R. 104.3f).
EDIT: Edited after comment 4 was posted.
EDIT (Feb. 13): Correctness edit.
Does that mean my opponent takes zero damage whether or not an effect prevented me from losing the game?
I've edited comment 2 in the meantime. In this scenario, even though Char doesn't deal damage to you due to Nefarious Lich (but something else happens instead), it will still deal 4 damage to your opponent (and your opponent will lose 4 life [C.R. 119.3a], among other things [C.R. 119.3]).
Sorry for the double post, but I just realized something:
If a replacement effect replaces one action with a modified event that involves two actions (drawing and dealing damage), wouldn't those actions in the modified event be sequential?
EDIT: And it was all for naught. C.R. 120.7 says they are sequential if part of an event would be replaced with card draw.
I have an empty library and both me and my opponent are at 40 life. I control the following: Firesong and Sunspeaker, Laboratory Maniac, and Nefarious Lich.
I cast Char targeting my opponent. In response, my opponent exiles my graveyard with Rakdos Charm. Char then resolves.
What happens?
But instead of Char dealing 2 damage to you, you would exile that many cards from your graveyard instead. But since you can't, you lose the game (see also C.R. 117.12). (Since the damage that would be dealt to you is replaced, it never happens [C.R. 119.4c, 614.6].)
That leaves Char dealing 4 damage to your opponent. The damage dealt by Char this way would make your opponent lose 4 life and make you gain 4 life due to lifelink, but instead you would draw 4 cards, but instead you would win the game since your library is empty (C.R. 119.3a, 119.3f, 614.6).
And if a player would both win and lose the game simultaneously, that player loses the game (C.R. 104.3f).
EDIT: Edited after comment 4 was posted.
EDIT (Feb. 13): Correctness edit.
I knew 104.3f would be possible somehow.
Thank you!
EDIT: NVM, see post below.
If a replacement effect replaces one action with a modified event that involves two actions (drawing and dealing damage), wouldn't those actions in the modified event be sequential?
EDIT: And it was all for naught. C.R. 120.7 says they are sequential if part of an event would be replaced with card draw.
Sigh. Oh well!