to me, the `preconfigopts` and `premakeopts` you're using here warrant an easyblock for `motif`, this is very messy/hackish...