Allow running the script from any subdirectory

The script assumes it is running from the root of the repository. This change allows using the script from any subdirectory as well.