Add CFLAGS and improve build.sh

* Added -Wall and -Wextra to improve code quality.

* Added -Werror to force improvement of code quality.

* Added -g for improved debugging.  Added dSYM directory to
  .gitignore for OS X targets.

* Added support for overriding CC, CFLAGS, and LDFLAGS from
  the parent environment.

* Default CC to clang instead of gcc.

* Capture sources from current directory instead of
  hard-coding sources in build.sh.

* Exit with nonzero if compiler fails.