Use ncurses' pkg-config file

This helps building against ncurses being built with a separate libtinfo, but it's also more appropriate to use LDLIBS here instead of abusing CFLAGS, since this puts CFLAGS/LDFLAGS/LDLIBS/source files in the correct order for newer ld features such as --as-needed to work.