Fix static library builds for all compilers. Partial fix for #53.

See also #66.