In a gas the atoms are moving randomly. In a solid, the atoms can move randomly about their equilibrium positions. In addition, the solid as a whole can move with a given velocity and have ordered kinetic energy. Only the kinetic energy associated with the random motion of the atoms is proportional to absolute temperature of the solid. The average kinetic energy associated with the random motion of a any substance is proportional to the absolute temperature of the substance .
Thermal energy is disordered energy.
Temperature is a measure of this internal, disordered energy. While in ideal gases the disordered energy is all kinetic energy, in solids it is a combination of kinetic and potential energy. If we model the atoms in a solid as being held together by tiny springs, the random kinetic energy of each atom constantly switches between kinetic energy and elastic potential energy. You can add thermal energy to an object by doing work on the object. If you rub an object, the force of sliding friction does work, and changes ordered kinetic energy into thermal energy.