[lldb] fix Makefile cross platform macros (#183131)
This patch fixes cross platform Makefile.rules macros and adds the
`ECHO_TO_EXISTING_FILE` macros.
Using `echo` in a macro to write to a file had quoting issues.
This is a reland of https://github.com/llvm/llvm-project/issues/183090.