Make dynamic linking optional when configuring.

This is required for the kFreeBSD backend as its (modified) compiler cannot do dynamic linking.