Add more warnings to Makefile.

Use -Wextra and -Wpedantic. Also, change the handling of CFLAGS
so that it's easier to switch between debug and release builds.
Fix warnings from -Wall -Wextra -Wpedantic