Dynamics and Thermodynamics of a model with long-range interactions