I'm thinking it's trying to come back on too quickly and tripping its own overlaod breaker. When that happens you hear a hum like the compressor is starting and then a click as the breaker cuts it back off. Then the question is why is it doing that?
You could also have a blown or failing start capacitor. Heat and low voltage maybe be driving it to fail. Or the compressor itself may be going but that isn't likely.
If you haven't ever replace these, it shold be done every ten years or more if it's used a lot.
I would check the start cap(s) first. They're a cheap and easy fix.
Your thermostat should not allow the compressor to come back on within 5 minutes of it shutting down. This protects it from dead-heading.