I've set up mingw and msys on Windows 7 in: C:\msys\mingw.

While installing libjpeg, the command   ./configure --prefix=/usr/local --enable-share
shows error:
configure: error: C compiler cannot create executables
See 'config.log' for more details.

Excerpts from config.log are as follows:
... ... ...
configure:3372: checking whether the C compiler works
configure:3394: gcc    conftest.c  >&5
c:/msys/mingw/bin/../lib/gcc/mingw32/4.5.0/../../../../mingw32/bin/ld.exe: reopening a.exe: Permission denied

c:/msys/mingw/bin/../lib/gcc/mingw32/4.5.0/../../../../mingw32/bin/ld.exe: final link failed: Permission denied
collect2: ld returned 1 exit status
configure:3398: $? = 1
configure:3436: result: no
... ... ...

What is going wrong.. pls help.
Note: This error is only with libjpeg, other stuff like libtiff, Freetype etc. have no issues
         running their configure.

Regards, Ameet.