Unable to compile Nvidia Flex on Ubuntu

I’m trying to compile Flex on Linux (Ubuntu 14.04). I’m getting the following error that I haven’t been able to wrap my head around:

/usr/bin/ld: …/…/…/external/SDL2-2.0.4/lib/x64//libSDL2.a(SDL_syssem.o): undefined reference to symbol ‘sem_getvalue@@GLIBC_2.2.5
//lib/x86_64-linux-gnu/libpthread.so.0: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status

I have CUDA 7.5 installed with one of the latest NVIDIA drivers. Would appreciate your comments on how I should solve the issue.

it looks like your libSDL2.a was compiled using a toolchain that does not match your current toolchain on Ubuntu 14.04, but has specific dependencies against GLIBC.

You could solve this by either recompiling the libSDL2.a using your current toolchain, getting a version of libSDL2.a that matches your current toolchain, or installing the needed GLIBC. The version of your GLIBC library generally is lined up with the specific gnu toolchain you are using, so this last option is roughly equivalent to saying “use the same gnu toolchain that your libSDL2.a was compiled with”.

or, as suggested in your cross posting on SO, maybe you just need to add -lpthreads or something like that to the failing link step. I was assuming you were using a properly crafted link commmand.