Issue when trying to run ROOT on LXBATCH

Hi list,
i’m running some programs on LXPLUS/LXBATCH machines at CERN, using ROOT version 5.17.04 from CERN. The programs runs correctly on LXPLUS machines but it gives this error when launched via LSF on LXBATCH:

error while loading shared libraries: libCore.so: cannot open shared object file: No such file or directory

This is in my .bashrc

export ROOTSYS=/afs/cern.ch/sw/lcg/external/root/5.17.04/slc4_ia32_gcc34/root
export PATH=$ROOTSYS/bin:$PATH
export LD_LIBRARY_PATH=$ROOTSYS/lib:$LD_LIBRARY_PATH

I’ve tried to produce a

echo $LD_LIBRARY_PATH

on LXBATCH and the result is correct, as i would expect it to be.

This is the makefile i’m using in order to compile the analysis executable:

CC=g++
CFLAGS=-Wall -m32  -O2
INCLUDE=-I/usr/local/include/shift
ROOTFLAGS=-lRFIO -O -fPIC -lSpectrum -lRCastor
all: analisi.gamma.nic.exe
analisi.gamma.nic.exe: analisi.gamma.nic.c
        $(CC) $(CFLAGS) analisi.gamma.nic.c $(INCLUDE) $(VARIAFLAGS) `root-config --cflags --glibs` $(ROOTFLAGS) -o analisi.gamma.nic.exe
clean:
rm analisi.gamma.nic.exe

(this compiles always correctly)

Is there is something wrong here or could it be an LXBATCH error?

Thanks in advance,
marco