loci: build a static loci library in locitest

Having the static library target is useful for benchmarking the build.
diff --git a/c_gen/templates/locitest/Makefile b/c_gen/templates/locitest/Makefile
index a7a6f37..966fe9b 100644
--- a/c_gen/templates/locitest/Makefile
+++ b/c_gen/templates/locitest/Makefile
@@ -1,15 +1,22 @@
-SRCS := $(wildcard src/*.c)
-SRCS += $(wildcard ../loci/src/*.c)
+LOCITEST_SRCS := $(wildcard src/*.c)
+LOCI_SRCS := $(wildcard ../loci/src/*.c)
 
-OBJS := $(SRCS:.c=.o)
+LOCITEST_OBJS := $(LOCITEST_SRCS:.c=.o)
+LOCI_OBJS := $(LOCI_SRCS:.c=.o)
 
 CFLAGS := -Wall -Werror -g
 CFLAGS += -Iinc -I../loci/inc -I ../loci/src
 
 all: locitest
 
-locitest: $(OBJS)
+locitest: $(LOCITEST_OBJS) loci.a
 	$(CC) $^ -o $@
 
+loci.a: $(LOCI_OBJS)
+	ar rc $@ $^
+
+clean:
+	rm -f locitest loci.a $(LOCITEST_OBJS) $(LOCI_OBJS)
+
 # BSN build system magic
 MODULE := locitest