Non-equilibrium thermodynamics and anomalous diffusion