Add warning flags to makefile and fix all warnings from gcc-4.8.2.