A novel Thermodynamic Integration scheme to derive Gibbs free energies for flexible materials