Fix -ldl definitions for compatibility

Fix -ldl definitions for compatibility (across UNIX systems).