g++ main.cpp -o appname -I<path to includes> -L<path to libraries>
This is missing linking any libraries though. -L says where libraries are, but -l says which libraries to link.
From what I see in your tasks.json, none of the sfml libraries have -l, so they aren't being linked.
Although I don't do mac dev, so I don't know anything about dylibs or tasks.json, just guessing here.