Make dynamic linking optional when configuring.

This change is required to disable shared libraries for the Mirage kFreeBSD backend.