As a stopgap measure to get opencv to compile while this issue gets sorted, you can help the build find the missing library by editing CMakeLists.txt
atomic_load_8 is defined in libatomic.so
Find this file by typing $ sudo find / -type f -name ‘atom.so*’
One of the results is
/usr/lib/arm-linux-gnueabihf/libatomic.so.1.2.0
Now go to your opencv clone folder and edit CMakeLists.txt
pi@raspberrypi:~/opencv $ sudo nano CMakeLists.txt
at line 84 right after
Configure OpenCV CMake hooks
add these 2 lines:
find_library(RESULT libatomic.so.1.2.0 PATHS /usr/lib/arm-linux-gnueabihf)
link_libraries(${RESULT})
Exit and save changes.
Now run cmake with -D OPENCV_FORCE_LIBATOMIC_COMPILER_CHECK=1
as one of your options.
And continue with make to build, which should now go to 100%.