Easy linking type switching

Allow switching between static and dynamic linking with a variable in the Makefile. Necessary for easy packaging in Archlinux, where static libs are not built by default.