Added thermodynamic integration and fixed fortran linking with gcc