forgot to fclose
add getopt.h
exit -> return
switched standard to c99 and fixed a makefile bug

c99 should be the standard we follow in the makefile
sysfs code wouldn't be built because ${DEFINES} wasn't there