Is it legal to make shareware games based on Middle-earth?
No, not without permission (see question 6.3). There have nevertheless been a few releases without permission and I have heard of no threats of law-suits, but if you want to play safe, base your shareware games on something else. An exception from this rule (and including commercial releases) is parodies, which do not require any kind of licence or permission.