Thermodynamics of perfect elastic fluids