add libgen.h (fix linker related segfault on osx)