Traditionally, linkers process files from left to right, so if X depends on Y, X must be added before Y in the command. So place your source files before the libraries they depend on.
g++ main.cpp -o main -I /usr/local/include/SEAL-4.1 -L /usr/local/lib -lseal-4.1