> What are the odds of being born a human and not a bacteria, a fly, or, apparently, a nematode?
Well you probably have to be a human to ask yourself that so it seems fallacious to argue like that.
> What are the odds that I would be born into a wealthy country?
10% maybe?
> What are the odds that I would be born into what appears to be the end of history -- the most prosperous species in the most prosperous time of Earth's 4 billion year history of life, where I can live comfortably, but technology has created multiple civilization-ending threats that will probably come into fruition shortly after I am gone (should I be so lucky)?
Since the human population is at a peak currently, probably not that bad. From a quick google search it looks like only about 110 billion people ever existed and there are currently 8 billion people alive so the chance of being alive currently given you’re a random human is about 7%.
And also I don’t think human civilization will end in the foreseeable future. Climate change is going to lead to some changes but overall humans aren’t even close to going extinct.