title: Add shared library to makefile
body: <p>I want to link a shared library  <code>libfoo.so</code>,and its relative path is <code>../path/to/lib</code>.following compile command:</p>
  
  <pre><code>g++ -o /executable/path test.o -L../path/to/lib -lfoo
  </code></pre>
  
  <p>gives</p>
  
  <pre><code>/usr/bin/ld: can not find -lfoo
  collect2: error: ld returned 1 exit status
  </code></pre>
  
  <p>and this command gives a different error message</p>
  
  <pre><code>g++ -o /executable/path test.o -L../path/to/lib/libfoo.so
  </code></pre>
  
  <p>gives</p>
  
  <pre><code>undefined reference to 'functions and class members in libfoo.so'
  </code></pre>
  
  <p>It seems neither compiles right.Did I miss something?</p>