Define PYTHON in library/Makefile

Copy the definition from tests/Makefile and programs/Makefile: default to
`python3` on Unix-like platforms where `python3` exists and to `python`
otherwise.

This is necessary on Unix-like platforms where python3 doesn't exist and on
Windows platforms where neither the shebang nor the extension works to run a
Python script.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
diff --git a/library/Makefile b/library/Makefile
index 6335dcc..c4e722e 100644
--- a/library/Makefile
+++ b/library/Makefile
@@ -23,6 +23,11 @@
 # CFLAGS += -D_BSD_EXTENSION
 
 PERL ?= perl
+ifdef WINDOWS
+PYTHON ?= python
+else
+PYTHON ?= $(shell if type python3 >/dev/null 2>/dev/null; then echo python3; else echo python; fi)
+endif
 
 # if were running on Windows build for Windows
 ifdef WINDOWS