The last position (wKe1, wRg7, wRh7, bKh8) is in fact possible. Last move was Rxh7, capturing anything except a pawn. Something like this is illegal though:
Impossible checkmates
Sort:
@ Remellion: you are right about the last position, if Black cooperates it is possible.
As for your example, I don't understand why it is illegal. Is it because the pawns are forced to move at times?
Anyway, more examples:
If you try to reach the position I gave from a legal game, you'll never be able to. To see that, try asking "what was black's move before white's last move?" - that may turn up some issues.
This too is illegal. It's actually not as easy as you might think to show that a position is legal or illegal - some make good puzzles.
I'd like to see checkmates positions which are impossible to achieve in game.