To build gm2 under OpenBSD and NetBSD you can use:
$ pkg_add bash gmake pth flex
The build process will fail when building the texinfo documentation. But you should be able to perform
$ make install
and have a working gm2 without documentation or manpages. This has been reported to work in OpenBSD 5.2, OpenBSD 4.8 and NetBSD 6.0.