Add `-ldl`.

This is required for compatibility with glibc, and doesn't seem to hurt
when building on OS X.