Thermodynamics of a continuum with internal constraints