Allow building static libs.
Allow building static libs.

Summary:
Commit 90538d86af579595987826cd893828d6f379f35a, seems to have broken static linking.
The introduction of `argFixup` in `runLink` rearranges libs, and considers
anything with an `-l` prefix or `.a` suffix a lib, which fails for libs that are
just being linked together (e.g. `-o lib.a`).

The proposed solution explicitly checks for the existance of the `-o` flag.

Reviewers: rwbarton, erikd, Phyx, bgamari, austin

Reviewed By: Phyx

Subscribers: thomie

Differential Revision: https://phabricator.haskell.org/D2362

shlevy/ghc,ezyang/ghc,mettekou/ghc,olsner/ghc,olsner/ghc,sdiehl/ghc,ezyang/ghc,mettekou/ghc,shlevy/ghc,ezyang/ghc,ezyang/ghc,sgillespie/ghc,sgillespie/ghc,vTurbine/ghc,shlevy/ghc,ezyang/ghc,vTurbine/ghc,snoyberg/ghc,sdiehl/ghc,sgillespie/ghc,ezyang/ghc,sdiehl/ghc,vTurbine/ghc,sdiehl/ghc,vTurbine/ghc,ezyang/ghc,sgillespie/ghc,vTurbine/ghc,olsner/ghc,olsner/ghc,sgillespie/ghc,sdiehl/ghc,vTurbine/ghc,snoyberg/ghc,mettekou/ghc,snoyberg/ghc,shlevy/ghc,shlevy/ghc,shlevy/ghc,olsner/ghc,mettekou/ghc,olsner/ghc,shlevy/ghc,sgillespie/ghc,mettekou/ghc,snoyberg/ghc,snoyberg/ghc,snoyberg/ghc,vTurbine/ghc,olsner/ghc,snoyberg/ghc,mettekou/ghc,sdiehl/ghc,sgillespie/ghc,sdiehl/ghc,mettekou/ghc