I had a similar expirience.
A combination of lammps 5Oct2007 with lam 7.1.1 and gcc 3.2.2 resulted in the same compilation error in the bond_quartic.cpp file.
However using the icc 9.1 and the appropriate lam binaries compiler I successfully compiled the code.
Vladimir