GFortran compiler error on Mac OS Big Sur
I have been able to fix the issue with the help of the following two posts:

https://developer.apple.com/forums/thread/666700
https://stackoverflow.com/questions/27314733/make-usr-local-lib-a-default-library-search-path-for-ld-on-mac-os-x

The problem is that after the update the System library is no longer in the search paths of the gcc. I solved this by adding it manually to the zprofile, so that anytime I run the Terminal, variable $LIBRARY_PATH is set.
To fix this issue
Edit file /private/etc/zprofile
Add this to the end of the file:
if [ -z &quot;${LIBRARY_PATH}&quot; ]; then
    export LIBRARY_PATH=&quot;/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib&quot;
else
    export LIBRARY_PATH=&quot;$LIBRARY_PATH:/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib&quot;
fi

Restart Terminal