--- a/Makefile.am
+++ b/Makefile.am
@@ -619,7 +619,7 @@
 # php/00README.txt php/recoll/config.m4 php/recoll/make.sh
 # php/recoll/php_recoll.h php/recoll/recoll.cpp php/sample/shell.php
 
-OPTSFORPYTHON = $(shell test -f /etc/debian_version && echo --install-layout=deb)
+OPTSFORPYTHON =
 
 if MAKEPYTHON
 all-local:: recollpython
@@ -627,13 +627,13 @@
 clean-local:: recollpython-clean
 recollpython: librecoll.la
 	(cd python/recoll; set -x; \
-        for v in 2 3;do test -n "`which python$${v}`" && \
+        for v in 3;do test -n "`command -v python$${v}`" && \
         libdir=$(libdir) python$${v} setup.py build; \
         done \
         )
 recollpython-install:
 	(cd python/recoll; set -x; \
-        for v in 2 3;do test -n "`which python$${v}`" && \
+        for v in 3;do test -n "`command -v python$${v}`" && \
         python$${v} setup.py install \
          --prefix=${prefix} --root=$${DESTDIR:-/} $(OPTSFORPYTHON); \
         done; \
--- a/Makefile.in
+++ b/Makefile.in
@@ -1145,7 +1145,7 @@
 # someone fixes it:
 # php/00README.txt php/recoll/config.m4 php/recoll/make.sh
 # php/recoll/php_recoll.h php/recoll/recoll.cpp php/sample/shell.php
-OPTSFORPYTHON = $(shell test -f /etc/debian_version && echo --install-layout=deb)
+OPTSFORPYTHON =
 defconfdir = $(pkgdatadir)/examples
 defconf_DATA = \
 desktop/recollindex.desktop \
@@ -2802,13 +2802,13 @@
 @MAKEPYTHON_TRUE@clean-local:: recollpython-clean
 @MAKEPYTHON_TRUE@recollpython: librecoll.la
 @MAKEPYTHON_TRUE@	(cd python/recoll; set -x; \
-@MAKEPYTHON_TRUE@        for v in 2 3;do test -n "`which python$${v}`" && \
+@MAKEPYTHON_TRUE@        for v in 3;do test -n "`command -v python$${v}`" && \
 @MAKEPYTHON_TRUE@        libdir=$(libdir) python$${v} setup.py build; \
 @MAKEPYTHON_TRUE@        done \
 @MAKEPYTHON_TRUE@        )
 @MAKEPYTHON_TRUE@recollpython-install:
 @MAKEPYTHON_TRUE@	(cd python/recoll; set -x; \
-@MAKEPYTHON_TRUE@        for v in 2 3;do test -n "`which python$${v}`" && \
+@MAKEPYTHON_TRUE@        for v in 3;do test -n "`command -v python$${v}`" && \
 @MAKEPYTHON_TRUE@        python$${v} setup.py install \
 @MAKEPYTHON_TRUE@         --prefix=${prefix} --root=$${DESTDIR:-/} $(OPTSFORPYTHON); \
 @MAKEPYTHON_TRUE@        done; \
