Hello Giuseppe,
LDFLAGS = -rdynamic -xCORE-AVX2 -Wl,--rpath,-L/usr/lib64/psm2-compat/libpsm_infinipath.so.1
You need to instead use:
LDFLAGS = ... -Wl,--rpath,/usr/lib64/psm2-compat/
ie specify the directory not the file.
Alternatively (and maybe better) you can try and set (or add to) the MPI variables instead like so:
MPI_LIB_DIRS = /usr/lib64/psm2-compat
which will also create a --rpath option eventually and also ensure that the library is found a link time by adding a -L option. This may however force you to also set MPI_INC_DIRS and MPI_LIBS.
You should be able to get information on what to put there from eg the old supermuc option list simfactory2/mdb/optionlists/supermuc-intelmpi.cfg and / or the information provided on https://docs.einsteintoolkit.org/et-docs/Configuring_a_new_machine
Yours, Roland