cleaned and tidied makefile. added better error handling (-Werror and others) in makefile. refactored things that didnt comply with -Werror