`undefined reference` and `bad reloc address` errors while using BinaryBuilder

I think this is a link order problem. Try moving -lcspice to the end of the link command:

$(CXX) $(LDFLAGS) $(LIBS) -shared -fPIC -L$(prefix)/lib -o $@ $^ -lcspice