Please help me to solve OpenCV problem!

I have single board pc recomputer j1020 (from Jetson Nano 4G, A206 carrier board). Extern Storage Samsung 512 GB.
My computer hat error message of OpenCV during the compile. Could you please help me to fix this following errors:

jetsonj1020@ubuntu:~$ pkg-config --modversion opencv
Package opencv was not found in the pkg-config search path.
Perhaps you should add the directory containing `opencv.pc’
to the PKG_CONFIG_PATH environment variable
No package ‘opencv’ found

and:

g++: error: unrecognized command line option ‘-mavx’
g++: error: unrecognized command line option ‘-mavx2’
g++: error: unrecognized command line option ‘-msse3’
g++: error: unrecognized command line option ‘-msse4.1’
g++: error: unrecognized command line option ‘-msse4.2’
g++: error: unrecognized command line option ‘-msse4a’
Makefile:182: recipe for target ‘obj/image_opencv.o’ failed

For more details:
I want to use this PC to aplly and compile darknet and yolo to object detection object. For this pourpose it requires an installation of OpenCV library.
I tried to install OpenCV with: “sudo apt install pkg-config libopencv-dev”. It worked well.

Then I want to check OpenCV is installed correctly with: “pkg-config --modversion opencv”
It came following error:

jetsonj1020@ubuntu:~$ pkg-config --modversion opencv
Package opencv was not found in the pkg-config search path.
Perhaps you should add the directory containing `opencv.pc’
to the PKG_CONFIG_PATH environment variable
No package ‘opencv’ found

Then I tried:

jetsonj1020@ubuntu:~$ dpkg -l | grep libopencv
ii libopencv 4.1.1-2-gd5a58aa75 arm64 Open Computer Vision Library
ii libopencv-calib3d3.2:arm64 3.2.0+dfsg-4ubuntu0.1 arm64 computer vision Camera Calibration library
ii libopencv-contrib3.2:arm64 3.2.0+dfsg-4ubuntu0.1 arm64 computer vision contrlib library
ii libopencv-core3.2:arm64 3.2.0+dfsg-4ubuntu0.1 arm64 computer vision core library
ii libopencv-dev 4.1.1-2-gd5a58aa75 arm64 Development files for Open Source Computer Vision Library
ii libopencv-features2d3.2:arm64 3.2.0+dfsg-4ubuntu0.1 arm64 computer vision Feature Detection and Descriptor Extraction library
ii libopencv-flann3.2:arm64 3.2.0+dfsg-4ubuntu0.1 arm64 computer vision Clustering and Search in Multi-Dimensional spaces library
ii libopencv-highgui3.2:arm64 3.2.0+dfsg-4ubuntu0.1 arm64 computer vision High-level GUI and Media I/O library
ii libopencv-imgcodecs3.2:arm64 3.2.0+dfsg-4ubuntu0.1 arm64 computer vision Image Codecs library
ii libopencv-imgproc3.2:arm64 3.2.0+dfsg-4ubuntu0.1 arm64 computer vision Image Processing library
ii libopencv-ml3.2:arm64 3.2.0+dfsg-4ubuntu0.1 arm64 computer vision Machine Learning library
ii libopencv-objdetect3.2:arm64 3.2.0+dfsg-4ubuntu0.1 arm64 computer vision Object Detection library
ii libopencv-photo3.2:arm64 3.2.0+dfsg-4ubuntu0.1 arm64 computer vision computational photography library
ii libopencv-python 4.1.1-2-gd5a58aa75 arm64 Python bindings for Open Source Computer Vision Library
ii libopencv-samples 4.1.1-2-gd5a58aa75 arm64 Samples for Open Source Computer Vision Library
ii libopencv-shape3.2:arm64 3.2.0+dfsg-4ubuntu0.1 arm64 computer vision shape descriptors and matchers library
ii libopencv-stitching3.2:arm64 3.2.0+dfsg-4ubuntu0.1 arm64 computer vision image stitching library
ii libopencv-superres3.2:arm64 3.2.0+dfsg-4ubuntu0.1 arm64 computer vision Super Resolution library
ii libopencv-video3.2:arm64 3.2.0+dfsg-4ubuntu0.1 arm64 computer vision Video analysis library
ii libopencv-videoio3.2:arm64 3.2.0+dfsg-4ubuntu0.1 arm64 computer vision Video I/O library
ii libopencv-videostab3.2:arm64 3.2.0+dfsg-4ubuntu0.1 arm64 computer vision video stabilization library
ii libopencv-viz3.2:arm64 3.2.0+dfsg-4ubuntu0.1 arm64 computer vision 3D data visualization library

So I understand that in my conputer OpenCV is installed but there are error, I don’t know how to fix.
I compiled continuous “darknet” with the followingg steps (from: ccoderun.ca/programming/darknet_faq/#how_to_build_on_linux):

sudo apt-get install build-essential git libopencv-dev
mkdir ~/src
cd ~/src
git clone GitHub - AlexeyAB/darknet: YOLOv4 / Scaled-YOLOv4 / YOLO - Neural Networks for Object Detection (Windows and Linux version of Darknet )
cd darknet

edit Makefile to set LIBSO=1, and possibly other flags

make
sudo cp libdarknet.so /usr/local/lib/
sudo cp include/darknet.h /usr/local/include/
sudo ldconfig

There are what happen in the terminal:

jetsonj1020@ubuntu:~$ sudo apt-get install build-essential git libopencv-dev

[sudo] password for jetsonj1020:
Reading package lists… Done
Building dependency tree
Reading state information… Done
build-essential is already the newest version (12.4ubuntu1).
build-essential set to manually installed.
git is already the newest version (1:2.17.1-1ubuntu0.16).
libopencv-dev is already the newest version (4.1.1-2-gd5a58aa75).
The following packages were automatically installed and are no longer required:
apt-clone archdetect-deb bogl-bterm busybox-static cryptsetup-bin
dpkg-repack gir1.2-timezonemap-1.0 gir1.2-xkl-1.0 grub-common
kde-window-manager kinit kio kpackagetool5 kwayland-data kwin-common
kwin-data kwin-x11 libdebian-installer4 libkdecorations2-5v5
libkdecorations2private5v5 libkf5activities5 libkf5attica5
libkf5completion-data libkf5completion5 libkf5declarative-data
libkf5declarative5 libkf5doctools5 libkf5globalaccel-data libkf5globalaccel5
libkf5globalaccelprivate5 libkf5idletime5 libkf5jobwidgets-data
libkf5jobwidgets5 libkf5kcmutils-data libkf5kcmutils5 libkf5kiocore5
libkf5kiontlm5 libkf5kiowidgets5 libkf5newstuff-data libkf5newstuff5
libkf5newstuffcore5 libkf5package-data libkf5package5 libkf5plasma5
libkf5quickaddons5 libkf5solid5 libkf5solid5-data libkf5sonnet5-data
libkf5sonnetcore5 libkf5sonnetui5 libkf5textwidgets-data libkf5textwidgets5
libkf5waylandclient5 libkf5waylandserver5 libkf5xmlgui-bin libkf5xmlgui-data
libkf5xmlgui5 libkscreenlocker5 libkwin4-effect-builtins1 libkwineffects11
libkwinglutils11 libkwinxrenderutils11 libqgsttools-p1 libqt5designer5
libqt5help5 libqt5multimedia5 libqt5multimedia5-plugins
libqt5multimediaquick-p5 libqt5multimediawidgets5 libqt5quickwidgets5
libxcb-composite0 libxcb-cursor0 libxcb-damage0 os-prober
python3-dbus.mainloop.pyqt5 python3-icu python3-pam python3-pyqt5
python3-pyqt5.qtsvg python3-pyqt5.qtwebkit
qml-module-org-kde-kquickcontrolsaddons qml-module-qtmultimedia
qml-module-qtquick2 rdate tasksel tasksel-data
Use ‘sudo apt autoremove’ to remove them.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

jetsonj1020@ubuntu:~$ mkdir src_darknet

jetsonj1020@ubuntu:~$ cd src_darknet/

jetsonj1020@ubuntu:~/src_darknet$ git clone GitHub - AlexeyAB/darknet: YOLOv4 / Scaled-YOLOv4 / YOLO - Neural Networks for Object Detection (Windows and Linux version of Darknet )
Cloning into ‘darknet’…
remote: Enumerating objects: 15502, done.
remote: Total 15502 (delta 0), reused 0 (delta 0), pack-reused 15502
Receiving objects: 100% (15502/15502), 14.17 MiB | 5.63 MiB/s, done.
Resolving deltas: 100% (10403/10403), done.

jetsonj1020@ubuntu:~/src_darknet/darknet$ make
mkdir -p ./obj/
mkdir -p backup
chmod +x *.sh
g++ -std=c++11 -std=c++11 -Iinclude/ -I3rdparty/stb/include -DOPENCV pkg-config --cflags opencv4 2> /dev/null || pkg-config --cflags opencv -Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-pragmas -fPIC -ffp-contract=fast -mavx -mavx2 -msse3 -msse4.1 -msse4.2 -msse4a -Ofast -DOPENCV -fopenmp -DZED_STEREO -I/usr/local/zed/include -fPIC -c ./src/image_opencv.cpp -o obj/image_opencv.o
g++: error: unrecognized command line option ‘-mavx’
g++: error: unrecognized command line option ‘-mavx2’
g++: error: unrecognized command line option ‘-msse3’
g++: error: unrecognized command line option ‘-msse4.1’
g++: error: unrecognized command line option ‘-msse4.2’
g++: error: unrecognized command line option ‘-msse4a’
Makefile:182: recipe for target ‘obj/image_opencv.o’ failed
make: *** [obj/image_opencv.o] Error 1

jetsonj1020@ubuntu:~/src_darknet/darknet$