The free energy of (approximately) harmonic solids can be calculated using a calculation similar as in the attached script.
Formally, for the Gibbs free energy a volume term pV can be added (where p is the external pressure, and V is the system volume), which might make sense if you want to compare the free energies at different volumes (although the pV correction is typically tiny).
Depending on what properties you are interested in, you could also include the electronic contributions to the free energy.
If the system has pronounced anharmonic contributions or is not even in the solid state (e.g gas phase molecules or liquids), it of course more complicated to obtain the absolute Gibbs free energy.