Makefiles: fix shell syntax error on Solaris for 1.0.2/master

PR: 3271 (fix incomplete)

When trying to build 1.0.2 beta 2 on Solaris I noticed, that the fix for #3271 was incomplete. The same problem happened in 3 Makefiles for beta1 but only one of them was fixed for beta2, 2 remain broken:
- engines/Makefile
- engines/ccgost/Makefile

The solution applied to the top Makefile (flipping the if and else parts) applies here as well.