Tweak the Makefile code for making .a libs; fixes trac #3642