[m] Add fix by bels to compile g3d on FreeBSD, thanks!