Fix compilation if python3 is the default python

Check if python2 is available and use it.