I don't have the greatest experience with linking to external libraries, but I'll give it a shot. From what I understand, setting LD_LIBRARY_PATH does not help except at runtime. You must manually tell the compiler to link the library in at compile-time. Take the math library for instance. Suppose I this source file:
value = 16.0;
square_root = sqrt(value);
printf("The square root is: %f\n", value);
This command results in:
$ gcc -o do_sqrt do_sqrt.c
/tmp/ccmTGmHd.o: In function `main':
/tmp/ccmTGmHd.o(.text+0x28): undefined reference to `sqrt'
collect2: ld returned 1 exit status
Until I give the compiler the '-lm' command to link in the math library, it won't work. Similarly, I imagine you'll have to do something like:
gcc -o my_app -lspeex my_app.c
Again, I may be way off base, but that would seem logical to me.