diff --git a/Makefile b/Makefile
index e484249065c8eae2cd1d219528a9f0b8e5bdc084..7d8ae4bb22026c116de68200d5270a82e3f36b02 100644
--- a/Makefile
+++ b/Makefile
@@ -181,7 +181,10 @@ clean::
 
 distclean::
 	$(RM) $(DISTCLEANSUFFIXES)
-	$(RM) config.* .config libavutil/avconfig.h .version avversion.h version.h libavutil/ffversion.h libavcodec/codec_names.h src
+	$(RM) config.* .config libavutil/avconfig.h .version avversion.h version.h libavutil/ffversion.h libavcodec/codec_names.h
+ifeq ($(SRC_LINK),src)
+	$(RM) src
+endif
 	$(RM) -rf doc/examples/pc-uninstalled
 
 config:
diff --git a/configure b/configure
index c415d5ab766ce321422c443c3c63c98d9c58086f..1000cb1766f936c6678a7a9fd77838c8bce6c43c 100755
--- a/configure
+++ b/configure
@@ -4710,7 +4710,7 @@ link_name=$(mktemp -u $TMPDIR/name_XXXXXXXX)
 mkdir "$link_dest"
 $ln_s "$link_dest" "$link_name"
 touch "$link_dest/test_file"
-if [ -e "$link_name/test_file" ]; then
+if [ "$source_path" != "." ] && ([ ! -d src ] || [ -L src ]) && [ -e "$link_name/test_file" ]; then
     # create link to source path
     [ -e src ] && rm src
     $ln_s "$source_path" src