Added -ldl for Linux dylib support
Fix linux compiler warnings (gcc).