Fixed makefile linking
Fixed perror leftovers