The external libraries needed by Aerospike requires the following flags for ld line:
LDFLAGS = -lssl -lcrypto -lpthread
ifneq ($(OS),Darwin)
LDFLAGS += -lrt -ldl
endif
This is taken from the Makefile used to build all example applications in the C client: