Fixing linking against dynamic libraries on BG/Q