Gamma-ray production cross section excitation functions have been measured for $30$, $42$, $54$ and $66$ MeV proton beams accelerated onto targets of astrophysical interest, $^{nat}$C, C + O (Mylar), $^{nat}$Mg, $^{nat}$Si and $^{56}$Fe, at the Sector Separated Cyclotron (SSC) of iThemba LABS (near Cape Town, South Africa). The AFRODITE array equipped with 8 Compton suppressed HPGe clover detectors was used to record $gamma$-ray data. For known, intense $gamma$-ray lines the previously reported experimental data measured up to $E_{p}simeq$ $25$ MeV at the Washington and Orsay tandem accelerators were extended to higher proton energies. Our experimental data for the last 3 targets are reported here and discussed with respect to previous data and the Murphy textit{et al.} compilation [ApJS 183, 142 (2009)], as well as to predictions of the nuclear reaction code TALYS. The overall agreement between theory and experiment obtained in first-approach calculations using default input parameters of TALYS has been appreciably improved by using modified optical model potential (OMP), deformation, and level density parameters. The OMP parameters have been extracted from theoretical fits to available experimental elastic/inelastic nucleon scattering angular distribution data by means of the coupled-channels reaction code OPTMAN. Experimental data for several new $gamma$-ray lines are also reported and discussed. The astrophysical implications of our results are emphasised.