Call ranlib on the unix static makefile.

This is required by the xmingw build.
Better suppression of unused parameter warnings.

The old ones gave a different warning on Apple's clang 4.2.
Don't remove unused test directories.

Reduces cruft on 'make clean'. I've rearranged some of the
non-functional self-test targets, but not really fixed them.
Add conditional source and libraries for mingw build.
Add an exe extension variable and use it in the mingw build.