I got the same error message when I was compiling mplayer. I traced the system call but didn't get any clue at the first attempt. It was same o/p as it is at the subject like :
wait4(-1, /usr/bin/ld: cannot open output file mplayer: Is a directory
"ld" binary is basically makes link with various object file and at the end of the compilation it usually does it. It was linking other object files with mplayer binary but there was a mplayer directory inside the current directory. That's made this error. I have renamed the directory and copied the mplayer binary from the renamed directory to the current directory. Then successfully recompiled and installed the mplayer.