configure tweaks, silence some warnings

Change-Id: I8075e112f872e6051d7cff812461870615310936
make it easier to use the clang static analyzer from the Makefile

also try to address some of the issues that it found

Change-Id: I11fa4555a1f995fd3a4e36ccf0bce0c1680e66e9