If you're using bash, you can also set the pipefail option globally. I have this once at the start of my makefiles and it catches errors even in the middle of a pipe:
# Make sure any errors in the middle of a pipe cause the build to fail SHELL=/bin/shbash -e -o pipefail (Changed from /bin/sh to /bin/bash based on MadScientist's comment)