Make bsd.progs.mk work with C++ apps a bit better; based on a patch from sjg@