The latch on the lid can be adjusted. Your second photo nicely shows the two screws that need to be loosened. Be careful. Once you loosen them, you're committed to making some sort of adjustment.
I've never had to do it so I can't advise with experience but the procedure is described at the bottom of
this page. I'm not so sure about using a hammer. Seems excessive. :/