Appropriately setting the `--target` flag is necessary when using clang
and building for a target other than the default. Zephyr generally
accomplishes this by setting the CMAKE_<LANG>_COMPILER_TARGET variables and
allowing cmake to automatically provide the `--target` flag when building.
For the external_lib sample, however, cmake can't add the flag and it was
not otherwise exported. As such, clang typically threw errors when building
this sample for any non-default targets due to mismatches between
target-specific flags and the default target.
To fix this, ensure we select the correct target by checking if
CMAKE_C_COMPILER_TARGET has been defined and adding
`--target=<triple>` to the list of flags that are exported if so.
Signed-off-by: Jonathon Penix <jpenix@quicinc.com>