add linker/archive options before and after a target

See CMake Issue 20078 , and in particular the discussion starting here.