changes to correctly link with libdl where required