Added #include <unistd.h>; thanks Dimitrios Bogiatzoules
added link dependency to libdl