always use 'mkdir -p' and fix missing dir (fixes #9876)

Summary: Signed-off-by: Joe Hillenbrand <joehillen@gmail.com>

Reviewers: thomie, austin

Reviewed By: thomie, austin

Subscribers: carter, thomie

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

GHC Trac Issues: #9876

(cherry picked from commit 9fc3aebd0920561d9d3c747e6b78591d332bed08)