Patches by Achim Gsell from PSI to allow build under Solaris

Configure may have failed before and when building inside the
source tree it is not nice if make clean removes source files!