This commit cleans up the Makefile and adds proper static linking.