Fix for systems with grep below version 2.5.3

Versions of grep below 2.5.3 do not support the `--exclude-dir` option.