Raspberry pi 4 64bit OS: c++: error: unrecognized command-line option '-mavx2'
**Describe the bug**
I am trying to build xmrig from github using my Raspberry Pi 64 bit 4 GB Variant. I am getting the below error while doing cmake:

Performing C++ SOURCE FILE Test VAES_SUPPORTED failed with the following output:
Change Dir: /home/pi/xmrig/build/CMakeFiles/CMakeTmp

Run Build Command(s):/usr/bin/gmake cmTC_b5ce8/fast && /usr/bin/gmake  -f CMakeFiles/cmTC_b5ce8.dir/build.make CMakeFiles/cmTC_b5ce8.dir/build
gmake[1]: Entering directory '/home/pi/xmrig/build/CMakeFiles/CMakeTmp'
Building CXX object CMakeFiles/cmTC_b5ce8.dir/src.cxx.o
/usr/bin/c++   -DVAES_SUPPORTED   -mavx2 -mvaes -o CMakeFiles/cmTC_b5ce8.dir/src.cxx.o -c /home/pi/xmrig/build/CMakeFiles/CMakeTmp/src.cxx
c++: error: unrecognized command-line option '-mavx2'
c++: error: unrecognized command-line option '-mvaes'
gmake[1]: *** [CMakeFiles/cmTC_b5ce8.dir/build.make:85: CMakeFiles/cmTC_b5ce8.dir/src.cxx.o] Error 1
gmake[1]: Leaving directory '/home/pi/xmrig/build/CMakeFiles/CMakeTmp'
gmake: *** [Makefile:140: cmTC_b5ce8/fast] Error 2


Source file was:
int main() { return 0; }

Can some one help what I am missing ?

**To Reproduce**
System Info:
Linux pi4mine 5.10.63-v8+ #1459 SMP PREEMPT Wed Oct 6 16:42:49 BST 2021 aarch64 GNU/Linux

cat /etc/os-release 
PRETTY_NAME="Debian GNU/Linux 11 (bullseye)"
NAME="Debian GNU/Linux"
VERSION_ID="11"
VERSION="11 (bullseye)"
VERSION_CODENAME=bullseye
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"



**Expected behavior**
A clear and concise description of what you expected to happen.

**Required data**
 - OS: Raspberry Pi 64 bit 4 GB
 - 


**Additional context**
The same one is working fine in my another Raspberry Pi 8 GB version. I don't understand what i am missing. I tried reinstalling the OS several times but no luck.
