Fix small memory leak from recent libpcp_gui record tmpfile fix
Continue Kens recent work with libdl on the installed makefiles

This commit extends the recent -ldl-via-macro makefile work (for the
*BSD build) to cover the other two libraries potentially requiring
platform-specifics, as for the rest of the build (-lm/-lpthread).
Filter the working directory from new pmwtf test output