I just have a system crash and reinstall Ubuntu 11.10, and my code produces this strange error.
I wrote a simple code sample to test where the problem is:
Change the compile line from
gcc -lrt test.c -o test
to
gcc test.c -o test -lrt