Revert a change introduced in d296aad2a9
for intended compatibility with BSD which breaks the build on MacOs:
"clang: error: unknown argument: '-n'" for "echo".
BSD users will have to use some workaround since MacOs is a supported
OS of IDF and BSD is not.
Extra space is needed in echo -n "-lncurses ", otherwise if pkg-config outputs a directory after that, it will result in "-lncurses-L/opt/local/lib" (without space).
-Wno-format-security flag is needed on macOS to silence warnings about printf(gettext("message")) constructs.