title: libtool: install: error: relink `libmyprog.la' with the above command before installing it
body: <p>I'm encountering the titular linking error while running <code>make distcheck</code> within a project I'm authoring:</p>
  
  <pre><code>$ uname -a
  Linux vbox 3.2.0-26-generic #41-Ubuntu SMP Thu Jun 14 17:49:24 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux
  $ cat /etc/issue
  Ubuntu 12.04 LTS \n \l
  
  $ libtool --version
  libtool (GNU libtool) 2.4.2
  Written by Gordon Matzigkeit &lt;gord@gnu.ai.mit.edu&gt;, 1996
  
  Copyright (C) 2011 Free Software Foundation, Inc.
  This is free software; see the source for copying conditions.  There is NO
  warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  $ g++ --version
  g++ (Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3
  Copyright (C) 2011 Free Software Foundation, Inc.
  This is free software; see the source for copying conditions.  There is NO
  warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  
  $ automake --version
  automake (GNU automake) 1.11.3
  Copyright (C) 2011 Free Software Foundation, Inc.
  License GPLv2+: GNU GPL version 2 or later &lt;http://gnu.org/licenses/gpl-2.0.html&gt;
  This is free software: you are free to change and redistribute it.
  There is NO WARRANTY, to the extent permitted by law.
  
  Written by Tom Tromey &lt;tromey@redhat.com&gt;
         and Alexandre Duret-Lutz &lt;adl@gnu.org&gt;.
  </code></pre>
  
  <p>As you can see it is coming up on Ubuntu 12.04 using g++ 4.6 and libtool 2.4.2.  On OS X 10.7.4 using g++ 4.2.1 and libtool 2.4.2 (both installed via homebrew) the error does not appear.  It also does not appear in <code>make check</code>.</p>
  
  <p>Here's the relevant snippet of <code>Makefile.am</code>:</p>
  
  <pre><code># -- myprog --
  #
  
  lib_LTLIBRARIES += myproj/myprog/libmyprog.la
  myproj_myprog_libmyprog_la_SOURCES = # ...
  myproj_myprog_libmyprog_la_LIBADD = myproj/mylib/libmylib.la
  
  sbin_PROGRAMS += myproj/myprog/myprog
  myproj_myprog_myprog_SOURCES = myproj/myprog/main.cc
  myproj_myprog_myprog_LDADD = myproj/myprog/libmyprog.la
  
  # -- mylib --
  #
  
  lib_LTLIBRARIES += myprog/mylib/libmylib.la
  myproj_mylib_libmylib_la_SOURCES = # ...
  </code></pre>
  
  <p>And the error itself:</p>
  
  <pre><code>/usr/bin/ld: cannot find -lmylib
  collect2: ld returned 1 exit status
  libtool: install: error: relink `myproj/myprog/libmyprog.la' with the above command before installing it
  </code></pre>
  
  <p>How do I fix this?</p>