Makefile: add -ltinfo and -ldl to libs

Needed on Ubuntu

Signed-off-by: Jiao Xiang <jxwr.cn@gmail.com>