Your remark here is absolutely correct, the protein must minimizes its structural free energy.
Enthalpy is just important as entropy in this respect.
The simplest microscopic (i.e. statistical mechanical) description of protein folding free energy is probably the so-called HP model. I found...