I am able to build and Windows and Linux platform components using the following Makefiles. You may find them cleaner and better way to compile. You will need to change the DEPTH and uncomment XPI_NAME for your use.

Main Makefile
=============
DEPTH = ../../..
topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@

include $(DEPTH)/config/autoconf.mk

DIRS = public

ifeq ($(MOZ_WIDGET_TOOLKIT),windows)
DIRS += source/windows
else
DIRS += source/linux
endif

DIRS += source

#XPI_NAME = minimizetotray

PREF_JS_EXPORTS = \
$(srcdir)/defaults/preferences/minimizetotray.js \
$(NULL)

EXTRA_PP_COMPONENTS = \
components/trayCommandLine.js \
$(NULL)

include $(topsrcdir)/config/rules.mk

Makefile in source/ directory
=============================
DEPTH = ../../../..
topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@

include $(DEPTH)/config/autoconf.mk

IS_COMPONENT = 1
MODULE = minimizetotray
LIBRARY_NAME = trayInterface
FORCE_SHARED_LIB = 1

#XPI_NAME = minimizetotray

EXPORTS = \
trayRoutine.h \
$(NULL)

REQUIRES = \
xpcom_glue \
xpcom \
string \
gfx \
widget \
docshell \
appshell \
dom \
content \
layout \
$(NULL)

CPPSRCS = \
MinimizeToTray.cpp \
trayRoutine.cpp \
$(NULL)

# Platform specific stuff

ifeq ($(MOZ_WIDGET_TOOLKIT),windows)
SHARED_LIBRARY_LIBS = windows/$(LIB_PREFIX)trayInterfacePlatform.$(LIB_SUFFIX)
OS_LIBS += shell32.lib
endif # windows

ifeq ($(MOZ_WIDGET_TOOLKIT),gtk2)
SHARED_LIBRARY_LIBS = linux/$(LIB_PREFIX)trayInterfacePlatform.$(LIB_SUFFIX)
endif # gtk2

include $(topsrcdir)/config/rules.mk

EXTRA_DSO_LDOPTS += \
$(XPCOM_GLUE_LDOPTS) \
$(NSPR_LIBS) \
$(NULL)

ifeq ($(MOZ_WIDGET_TOOLKIT),gtk2)
CXXFLAGS += \
$(MOZ_GTK2_CFLAGS) \
$(NULL)

EXTRA_DSO_LDOPTS += \
$(MOZ_GTK2_LIBS) \
$(XLIBS) \
$(NULL)
endif

Makefile in source/windows/ directory
=====================================
DEPTH = ../../../../..
topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@

include $(DEPTH)/config/autoconf.mk

MODULE = minimizetotray
LIBRARY_NAME = trayInterfacePlatform
FORCE_STATIC_LIB = 1
FORCE_USE_PIC = 1

REQUIRES = \
xpcom \
$(NULL)

CPPSRCS = \
trayToolkit.cpp \
trayWin32WindowHider.cpp \
trayWin32WindowIcon.cpp \
trayWin32WindowWatch.cpp \
$(NULL)

include $(topsrcdir)/config/rules.mk

Makefile in source/linux/ directory
===================================
DEPTH = ../../../../..
topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@

include $(DEPTH)/config/autoconf.mk

MODULE = minimizetotray
LIBRARY_NAME = trayInterfacePlatform
FORCE_STATIC_LIB = 1
FORCE_USE_PIC = 1

REQUIRES = \
xpcom \
$(NULL)

CPPSRCS = \
keyState.cpp \
trayLinuxWindowHider.cpp \
trayLinuxWindowIcon.cpp \
$(NULL)

include $(topsrcdir)/config/rules.mk

CXXFLAGS += \
-I$(srcdir)/.. \
$(MOZ_GTK2_CFLAGS)