implement SailfishOS support, made in collaboration with vakkov

sorry for building your hopes up, it currently segfaults:
https://bpaste.net/show/319c346897f6
i hope someone can help me out there

i've continued what vakkov started with cleanups and i tried to make it so that other platforms still work (but i cannot test all of them :()
Same here, try avoiding the `origin` function and just use conditional assignment:

Quote from https://www.gnu.org/software/make/manual/html_node/Flavors.html#Flavors:

<q>There is another assignment operator for variables, ‘?=’. This is called a conditional variable assignment operator, because it only has an effect if the variable is not yet defined. This statement:

FOO ?= bar

is exactly equivalent to this (see The origin Function):

ifeq ($(origin FOO), undefined)
  FOO = bar
endif

Note that a variable set to an empty value is still defined, so ‘?=’ will not set that variable. </q>