Makefile: add NEEDS_LIBGEN to optionally add -lgen to compile arguments