title: Makefile linking against a library
body: <p>I have the following makefile.I have the shared library <code>lcustom</code> in the path /usr/local/lib. I am using the functions from that library in my program <code>test.y</code> but it is giving undefined reference for the functions defined in <code>libcustom.so</code>.What is wrong with my makefile below.</p>
  
  <pre><code>all: test
  
  
  test.tab.c test.tab.h:  test.y
          bison -d test.y
  
  lex.yy.c: test.l test.tab.h
          flex test.l
  
  test: lex.yy.c test.tab.c test.tab.h test_util.c 
          gcc -lcustom -o test test.tab.c test_util.c lex.yy.c 
  
  clean:
      rm test test.tab.c lex.yy.c test.tab.h 
  </code></pre>