The most obvious fix is BBQ MORE! I mean seriously consider your commitment to BBQ 😂It wont clump if its empty!
But for a slightly more long term solution, the key is prevention! A cupboard is not a particularly stable environment because it isn't sealed it is susceptible to large variations in temperature and humidity. So firstly check your caps are on tight and try keeping the fresh seal inside the lid. This tends to cause a better airlock inside the container. If you're worried you might not be using a rub regularly also try keeping it in the fridge. The fact that a fridge is sealed creates an environment that is less vulnerable to seasonal temp and humidity changes.
If we're way past this and you're already dealing with a Rub slab. retrieve as much as you can from the container and blitz it in a coffee grinder or food processor. Keep in mind this will result in a finer consistency final product.
Good luck BBQers!