c++ – How to pass std::map by reference to std::thread?

I have a std::map I want to pass by reference to std::thread:

void estConnection(int sockfd, map<int,sockaddr_in> &clients, string document){
    ...
}

int main(){
    ...
    map <int, sockaddr_in> clients;
    std::thread th(estConnection, sockfd, std::ref(clients), document);
}

compiler (c++ main.cpp -o main) throws next error:

/usr/bin/ld: /tmp/ccJyzdF0.o: in function std::thread::thread<void (&)(int, std::map<int, sockaddr_in, std::less<int>, std::allocator<std::pair<int const, sockaddr_in> > >&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >), int&, std::reference_wrapper<std::map<int, sockaddr_in, std::less<int>, std::allocator<std::pair<int const, sockaddr_in> > > >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&, void>(void (&)(int, std::map<int, sockaddr_in, std::less<int>, std::allocator<std::pair<int const, sockaddr_in> > >&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >), int&, std::reference_wrapper<std::map<int, sockaddr_in, std::less<int>, std::allocator<std::pair<int const, sockaddr_in> > > >&&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&)': server.cpp:(.text._ZNSt6threadC2IRFviRSt3mapIi11sockaddr_inSt4lessIiESaISt4pairIKiS2_EEENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEJRiSt17reference_wrapperIS9_ERSG_EvEEOT_DpOT0_(_ZNSt6threadC5IRFviRSt3mapIi11sockaddr_inSt4lessIiESaISt4pairIKiS2_EEENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEJRiSt17reference_wrapperIS9_ERSG_EvEEOT_DpOT0_)+0x4f): undefined reference to pthread_create’ collect2: error: ld returned 1
exit status

The goal is to add a new value to map.
What am I doing wrong and how to solve this issue ?