Issue #1: added -ldl to prevent "undefined reference to `dlerror'"