Enforcing ensemble averages in molecular dynamics simulations using the Maximum Entropy principle