Add `-ldl`.

This is required for compatibility with glibc, and doesn't seem to hurt
when building on OS X.
Merge pull request #765 from danfuzz/dynamic-load

Add `-ldl`.