.out is an unusual extension. Usually this would normally signify a "trace output" file.
Check your syntax that you are using to compile
gcc myfile.c /usr/lib/libsomelibrary.a -o outputfilename
g++ myfile.cpp -lm -o outputfilename
You can should examine to see if the executable bit is set on the file
ls -l a.out
or you can just force the executable bit
chmod +x a.out
then you can run your file
You should also perhaps check that the output file has been written correctly as a binary
This will report what format the file is - either a script or a binary
You rarely need to execute as root unless you have restricted who should be able to run the executable.
If you have compiled as root (e.g. sudo make), or have a Makefile that installed the executable as root then can I suggest you regain the permission as the user logged in
sudo chown fred:fred a.out
i.e. replace "fred" with your user id.