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