Direct Monte Carlo calculation of anharmonic free energies