Instead of merging you want to rebase. You can do this manually, or automatically when pulling.
git pull --rebase upstream master
git push --force origin master
Once you've started doing merges though this will get hard to do, you'll need to reset the branch back to before you did a merge commit.