provide the proper compiler and linker arguments on Linux and FreeBSD using pkg-config

provide the proper compiler and linker arguments on Linux and FreeBSD using pkg-config