A derivation of a Guyer-Krumhansl type temperature equation in classical irreversible thermodynamics with internal variables