Linking problem when cross compiling for Raspberry Pi

I have an application which is using HDF5. I want to cross compile it for the Raspberry Pi. For this I mount the raspberry PI to a local folder which I use as sysroot. I installed hdf5 on the raspberry once via the package repository and once I did a manual compilation on the raspberry. However, in both cases I get errors when linking:
hdf5file.cpp.o: In function HDF5File::getChildren(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >*)': hdf5file.cpp:(.text+0x15b4): undefined reference toH5::CommonFG::openGroup(std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&) const’
hdf5file.cpp:(.text+0x15d4): undefined reference to H5::CommonFG::getNumObjs() const' hdf5file.cpp:(.text+0x1608): undefined reference toH5::CommonFG::getObjnameByIdx[abi:cxx11](unsigned long long) const’
hdf5file.cpp.o: In function HDF5File::readGroup(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*, int*)': hdf5file.cpp:(.text+0x1d34): undefined reference toH5::CommonFG::openGroup(std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&) const’
hdf5file.cpp:(.text+0x1d5c): undefined reference to H5::H5Location::openAttribute(char const*) const' hdf5file.cpp:(.text+0x1da6): undefined reference toH5::H5Location::openAttribute(char const*) const’
hdf5file.cpp.o: In function HDF5File::readDataset(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::vector<double, std::allocator<double> >*)': hdf5file.cpp:(.text+0x2846): undefined reference toH5::CommonFG::openDataSet(std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&) const’
fileio.cpp.o: In function HDF5File::readValueString(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&)': fileio.cpp:(.text._ZN8HDF5File15readValueStringERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES7_RS5_[_ZN8HDF5File15readValueStringERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES7_RS5_]+0x100): undefined reference toH5::H5Location::openAttribute(char const*) const’

At the end of my makefile (on my linux machine not the raspberry) I have
-L/opt/raspberry/sysroot/home/pi/hdf5-1.10.5/hdf5/lib/ -lhdf5 -lhdf5_cpp

How can I fix this?