New var in Makefile for switching linking type

Allow switching between static and dynamic linking with a variable in the Makefile.