Compiling GemRB, need some help

I’m trying to port the latest version (0.8.1) of GemRB to Haiku. An earlier version has been ported once before so it should be pretty straightforward. I’ve got pretty far into make after fixing some #include issues and it all builds up until it stumbles upon some C++ -> Python code. Here are the last lines of make:

[ 79%] Built target GAMImporter
Linking CXX shared module …/
/boot/system/lib/python2.6/config/libpython2.6.a(posixmodule.o): In function posix_openpty': /sources/Python-2.6.9/./Modules/posixmodule.c:3751: undefined reference toopenpty’
/boot/system/lib/python2.6/config/libpython2.6.a(posixmodule.o): In function posix_forkpty': /sources/Python-2.6.9/./Modules/posixmodule.c:3811: undefined reference toforkpty’
collect2: error: ld returned 1 exit status
make[2]: *** [gemrb/plugins/] Error 1
make[1]: *** [gemrb/plugins/GUIScript/CMakeFiles/GUIScript.dir/all] Error 2
make: *** [all] Error 2

What to do now?