python_runner: fix target finding at root

At the root level, where the default dummy toolchain is used, the stamp
tool is just 'stamp', so <TARGET_FILE()> wasn't working for them.

Now does.

No-Docs-Update-Reason: bugfix
Change-Id: I35c9f5ee084bbefafa6f9a5fb6112e2d097767ee
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/47400
Commit-Queue: Paul Mathieu <paulmathieu@google.com>
Reviewed-by: Wyatt Hepler <hepler@google.com>
diff --git a/pw_build/py/pw_build/python_runner.py b/pw_build/py/pw_build/python_runner.py
index 5c38717..7a21350 100755
--- a/pw_build/py/pw_build/python_runner.py
+++ b/pw_build/py/pw_build/python_runner.py
@@ -254,7 +254,9 @@
 
     # Older versions of GN used a .stamp file to signal completion of a target.
     stamp_dir = target.out_dir.relative_to(paths.build).as_posix()
-    stamp_tool = f'{target.toolchain_name()}_stamp'
+    stamp_tool = 'stamp'
+    if target.toolchain_name() != '':
+        stamp_tool = f'{target.toolchain_name()}_stamp'
     stamp_statement = f'build {stamp_dir}/{target.name}.stamp: {stamp_tool} '
 
     # Newer GN uses a phony Ninja target to signal completion of a target.