There are some conflicts with wait() function defined in test programs and OS X system wait(). I simply renamed the function, made some ld option compatible with OS X in Makefile. After that it compiled and works fine.