Thermodynamic description in a simple model for granular compaction