Update .gitignore to ignore all target-like dirs.

I also sorted lines in .gitignore. The file might include some obsoleted lines but I left.
Target folders only show up at the root, right? You can use the `/` prefix to ensure the pattern doesn't get used anywhere else.