title: proper way to link a library with autotools
body: <p>I need to link libmagic to my project which is built with autotools.</p>
  
  <p>my current solution is: <code>LIBS+="-lmagic"</code> in <code>configure.ac</code></p>
  
  <p>but I think that a more proper way to achieve this would be using <code>PKG_CHECK_MODULES</code> macro in <code>configure.ac</code> and <code>LDADD = @MAGIC_LIBS@</code> in Makefile.am, unfortunately this isn't working. </p>
  
  <p>here is what i'm getting from <code>./configure</code></p>
  
  <pre><code>configure: error: Package requirements (magic) were not met:
  
  No package 'magic' found
  
  Consider adjusting the PKG_CONFIG_PATH environment variable if you
  installed software in a non-standard prefix.
  </code></pre>
  
  <p>I think this has something to do with the absence of libmagic in pkg-config,
  any ideas?</p>