undefined reference to dlopen

@tpaluszk gets the error

undefined reference to `dlopen'

when linking C and Fortran executables in plugins/*/tests/ folders.

Tried to fix this but only managed to fix C tests by adding dl to target_link_libraries(user_code_02_c pdi mpi) in CMake.Lists.txt for each test file (adding this to Fortran tests still results in this error)