title: mingw ld cannot find some library which is exist in the search path
body: <p>I'm using vim+mingw, somehow, the terminal is still the window command.<br>
  so i google it, and using mintty. but when run vim, it hang forever until i type C-c.<br>
  i find <a href="https://code.google.com/p/mintty/issues/detail?id=56" rel="nofollow">this page</a>
  ,and wana try winpty.<br>
  but when i compile it , it comes out: </p>
  
  <pre><code>$ make
  Linking ../build/console.exe
  c:\mingw32\bin\ld.exe: cannot find -lpthread
  c:\mingw32\bin\ld.exe: cannot find -luser32
  c:\mingw32\bin\ld.exe: cannot find -lkernel32
  c:\mingw32\bin\ld.exe: cannot find -ladvapi32
  c:\mingw32\bin\ld.exe: cannot find -lshell32
  collect2: ld returned 1 exit status
  make: *** [../build/console.exe] Error 1
  </code></pre>
  
  <p>then i try <code>gcc -lpthread --verbose</code>, it is able to find pthread.a.<br>
  then i try<code>ld -lpthread --verbose</code>,the output is  </p>
  
  <pre><code>==================================================
  attempt to open /mingw/mingw32/lib/libpthread.dll.a failed
  attempt to open /mingw/mingw32/lib/pthread.dll.a failed
  attempt to open /mingw/mingw32/lib/libpthread.a failed
  attempt to open /mingw/mingw32/lib/pthread.lib failed
  attempt to open /mingw/mingw32/lib/libpthread.dll failed
  attempt to open /mingw/mingw32/lib/pthread.dll failed
  attempt to open /mingw/mingw32/lib\libpthread.a failed
  attempt to open /mingw/lib/libpthread.dll.a failed
  attempt to open /mingw/lib/pthread.dll.a failed
  attempt to open /mingw/lib/libpthread.a failed
  attempt to open /mingw/lib/pthread.lib failed
  attempt to open /mingw/lib/libpthread.dll failed
  attempt to open /mingw/lib/pthread.dll failed
  attempt to open /mingw/lib\libpthread.a failed
  attempt to open /usr/local/lib/libpthread.dll.a failed
  attempt to open /usr/local/lib/pthread.dll.a failed
  attempt to open /usr/local/lib/libpthread.a failed
  attempt to open /usr/local/lib/pthread.lib failed
  attempt to open /usr/local/lib/libpthread.dll failed
  attempt to open /usr/local/lib/pthread.dll failed
  attempt to open /usr/local/lib\libpthread.a failed
  attempt to open /lib/libpthread.dll.a failed
  attempt to open /lib/pthread.dll.a failed
  attempt to open /lib/libpthread.a failed
  attempt to open /lib/pthread.lib failed
  attempt to open /lib/libpthread.dll failed
  attempt to open /lib/pthread.dll failed
  attempt to open /lib\libpthread.a failed
  attempt to open /usr/lib/libpthread.dll.a failed
  attempt to open /usr/lib/pthread.dll.a failed
  attempt to open /usr/lib/libpthread.a failed
  attempt to open /usr/lib/pthread.lib failed
  attempt to open /usr/lib/libpthread.dll failed
  attempt to open /usr/lib/pthread.dll failed
  attempt to open /usr/lib\libpthread.a failed
  attempt to open /mingw/mingw32/lib/libpthread.dll.a failed
  attempt to open /mingw/mingw32/lib/pthread.dll.a failed
  attempt to open /mingw/mingw32/lib/libpthread.a failed
  attempt to open /mingw/mingw32/lib/pthread.lib failed
  attempt to open /mingw/mingw32/lib/libpthread.dll failed
  attempt to open /mingw/mingw32/lib/pthread.dll failed
  attempt to open /mingw/mingw32/lib\pthread.lib failed
  attempt to open /mingw/lib/libpthread.dll.a failed
  attempt to open /mingw/lib/pthread.dll.a failed
  attempt to open /mingw/lib/libpthread.a failed
  attempt to open /mingw/lib/pthread.lib failed
  attempt to open /mingw/lib/libpthread.dll failed
  attempt to open /mingw/lib/pthread.dll failed
  attempt to open /mingw/lib\pthread.lib failed
  attempt to open /usr/local/lib/libpthread.dll.a failed
  attempt to open /usr/local/lib/pthread.dll.a failed
  attempt to open /usr/local/lib/libpthread.a failed
  attempt to open /usr/local/lib/pthread.lib failed
  attempt to open /usr/local/lib/libpthread.dll failed
  attempt to open /usr/local/lib/pthread.dll failed
  attempt to open /usr/local/lib\pthread.lib failed
  attempt to open /lib/libpthread.dll.a failed
  attempt to open /lib/pthread.dll.a failed
  attempt to open /lib/libpthread.a failed
  attempt to open /lib/pthread.lib failed
  attempt to open /lib/libpthread.dll failed
  attempt to open /lib/pthread.dll failed
  </code></pre>
  
  <p>then i try <code>find /mingw -name *pthread*</code>the output is  </p>
  
  <pre><code>$ find /mingw -name *pthread*
  /mingw/bin/pthreadGC2.dll
  /mingw/bin/pthreadGCE2.dll
  /mingw/include/pthread.h
  /mingw/lib/libpthread.a
  /mingw/lib/libpthread.dll.a
  /mingw/lib/libpthreadGC2.a
  /mingw/lib/libpthreadGC2.dll.a
  /mingw/lib/libpthreadGCE2.dll.a
  /mingw/mingw32/include/pthread.h
  /mingw/mingw32/lib/libpthread.a
  /mingw/mingw32/lib/libpthread.dll.a
  /mingw/mingw32/lib/libpthreadGC2.a
  /mingw/mingw32/lib/libpthreadGC2.dll.a
  /mingw/mingw32/lib/libpthreadGCE2.dll.a
  /mingw/msys/1.0/include/pthread.h
  /mingw/share/doc/pthreads-w32
  /mingw/share/doc/pthreads-w32/2.9.1/README.pthreads-w32-2.9.1-1-mingw32
  /mingw/var/cache/mingw-get/packages/pthreads-w32-2.9.1-1-mingw32-dev.tar.lzma
  /mingw/var/cache/mingw-get/packages/pthreads-w32-2.9.1-1-mingw32-dll.tar.lzma
  /mingw/var/cache/mingw-get/packages/pthreads-w32-2.9.1-1-mingw32-doc.tar.lzma
  /mingw/var/cache/mingw-get/packages/pthreads-w32-2.9.1-1-mingw32-lic.tar.lzma
  /mingw/var/lib/mingw-get/data/mingw32-pthreads-w32.xml
  </code></pre>
  
  <p>oh, god, where is the evil? <code>\</code> and <code>/</code> ?<br>
  helppppppppppp :|</p>