make: support "make ssl-opt" to just build what ssl-opt.sh needs

This also suffices for compat.sh.

Include the sample programs in this build. They aren't tested by ssl-opt.sh
yet, but they soon will be.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
diff --git a/Makefile b/Makefile
index fb80529..00de608 100644
--- a/Makefile
+++ b/Makefile
@@ -28,6 +28,9 @@
 programs: lib mbedtls_test
 	$(MAKE) -C programs
 
+ssl-opt: lib mbedtls_test
+	$(MAKE) -C programs ssl-opt
+
 lib:
 	$(MAKE) -C library
 
diff --git a/programs/Makefile b/programs/Makefile
index 8d1da6d..0604a68 100644
--- a/programs/Makefile
+++ b/programs/Makefile
@@ -116,6 +116,12 @@
 all: fuzz
 endif
 
+SSL_OPT_APPS = $(filter ssl/%,$(APPS))
+SSL_OPT_APPS += test/query_compile_time_config test/udp_proxy
+# Just the programs needed to run ssl-opt.sh (and compat.sh)
+ssl-opt: $(patsubst %,%$(EXEXT),$(SSL_OPT_APPS))
+.PHONY: ssl-opt
+
 fuzz: ${MBEDTLS_TEST_OBJS}
 	$(MAKE) -C fuzz